<fieldset>
    <legend>{:lang('条件搜索')}</legend>
    <form class="layui-form layui-form-pane form-search" action="{:sysuri()}" onsubmit="return false" method="get" autocomplete="off">

         <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('用户编号')}</label>
            <label class="layui-input-inline">
                <input name="user_id" 
                value="{$get.user_id|default=''}" placeholder="{:lang('请输入用户编号')}" class="layui-input">
            </label>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('罐底码')}</label>
            <label class="layui-input-inline">
                <input name="trace_code" 
                value="{$get.trace_code|default=''}" placeholder="{:lang('请输入罐底码')}" class="layui-input">
            </label>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">{:lang('创建时间')}</label>
            <div class="layui-input-inline">
                <input data-date-range name="create_time" value="{$get.create_time|default=''}" placeholder="{:lang('请选择创建时间')}" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <button type="submit" class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> {:lang('搜 索')}</button>
            <button type="button" data-form-export="{:url('index')}?type={$type|default=''}" class="layui-btn layui-btn-primary">
                <i class="layui-icon layui-icon-export"></i> {:lang('导 出')}
            </button>
        </div>
    </form>
</fieldset>

<script>
     require(['excel'], function (excel) {
        excel.bind(function (data) {
             // 设置表格内容
            data.forEach(function (item, index) {
                data[index] = [item.id, item.trace_code, item.card_num, item.integral_num, item.user_id, item.city, item.shop_code, item.shop_name,
                item.product_code,item.product_name,item.wd_code,item.wd_name,item.is_newke,item.product_batch,item.price,item.status,item.create_time
                ];
            });
            // 设置表头内容
            data.unshift(['ID', '{:lang("罐底码")}', '{:lang("罐内码")}', '{:lang("积分")}', '{:lang("用户编号")}', '{:lang("定位城市")}', '{:lang("经销商编号")}', '{:lang("经销商名")}', '{:lang("商品编号")}', '{:lang("商品名")}', '{:lang("网点编号")}'
                , '{:lang("网点名称")}', '{:lang("新客")}', '{:lang("产品批次")}', '{:lang("红包")}', '{:lang("状态")}', '{:lang("创建时间")}'
            ]);
            
            // 应用表格样式
            return this.withStyle(data, {A: 60, B: 80, C: 99, E: 120, G: 120});

        }, '{:lang("用户扫码积分明细")}' + layui.util.toDateString(Date.now(), '_yyyyMMdd_HHmmss'));
    });
</script>